﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Index.aspx.cs" Inherits="NHDemo.Index" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <style type="text/css">
        h1 {
            text-align: center;
        }

        table.table {
            border-collapse: collapse;
            float: left;
        }

        .table td,.table th {
            border: 1px solid #000;
        }
        .no-border td,.noborder th {
            border:none;
        }

        .clear {
            clear: both;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:GridView ID="gv" runat="server"></asp:GridView>
        </div>
        <div class="clear">
            <h1>操作</h1>
            
            <table class="table">
                <tr>
                    <th colspan="2">Get（通过Id获取）</th>
                </tr>
                <tr>
                    <td colspan="2">
                   <asp:RadioButtonList ID="rbGetMode" runat="server" RepeatDirection="Horizontal" CssClass="no-border">
                    <asp:ListItem Value="0" Text="Sesson" Selected="True" />
                    <asp:ListItem Value="1" Text="HQL" />
                       <asp:ListItem Value="2" Text="SQL" />
                   </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>Id</td>
                    <td>
                        <asp:TextBox ID="txtGetId" runat="server" /></td>
                </tr>
                <tr>
                    <th colspan="2">
                        <asp:Button ID="btnGet" runat="server" Text="Get" OnClick="btnGet_Click" /></th>
                </tr>
                <tr>
                    <td colspan="2">展现：<asp:Label ID="lblGetDisplay" runat="server" /></td>
                </tr>
            </table>
            <table class="table">
                <tr>
                    <th colspan="2">Add（添加对象）</th>
                </tr>
                <tr>
                    <td>Id</td>
                    <td>自增</td>
                </tr>
                <tr>
                    <td>Name</td>
                    <td>
                        <asp:TextBox ID="txtAddName" runat="server" value="测试" /></td>
                </tr>
                <tr>
                    <td>Sex</td>
                    <td>
                        <asp:TextBox ID="txtAddSex" runat="server" value="男" /></td>
                </tr>
                <tr>
                    <td>Age</td>
                    <td>
                        <asp:TextBox ID="txtAddAge" runat="server" value="20" /></td>
                </tr>
                <tr>
                    <th colspan="2">
                        <asp:Button ID="btnAdd" runat="server" OnClick="btnAdd_Click" Text="Add" /></th>
                </tr>
            </table>
            <table class="table">
                <tr>
                    <th colspan="2">Update（修改对象）</th>
                </tr>
                <tr>
                    <td>Id</td>
                    <td>
                        <asp:TextBox ID="txtUpdateId" runat="server" />
                        <asp:Button ID="btnUpdateGet" runat="server" Text="Get" OnClick="btnUpdateGet_Click" />
                    </td>
                </tr>
                <tr>
                    <td>Name</td>
                    <td>
                        <asp:TextBox ID="txtUpdateName" runat="server" /></td>
                </tr>
                <tr>
                    <td>Sex</td>
                    <td>
                        <asp:TextBox ID="txtUpdateSex" runat="server" /></td>
                </tr>
                <tr>
                    <td>Age</td>
                    <td>
                        <asp:TextBox ID="txtUpdateAge" runat="server" /></td>
                </tr>
                <tr>
                    <th colspan="2">
                        <asp:Button ID="btnUpdate" runat="server" OnClick="btnUpdate_Click" Text="Update" /></th>
                </tr>
            </table>
            <table class="table">
                <tr>
                    <th colspan="2">Delete（通过Id删除）</th>
                </tr>
                <tr>
                    <td>Id</td>
                    <td>
                        <asp:TextBox ID="txtDeleteId" runat="server" /></td>
                </tr>
                <tr>
                    <th colspan="2">
                        <asp:Button ID="btnDelete" runat="server" OnClick="btnDelete_Click" Text="Delete" /></th>
                </tr>
            </table>
             <table class="table">
                <tr>
                    <th colspan="2">GetName（通过Id获取）</th>
                </tr>
                <tr>
                    <td colspan="2">
                   <asp:RadioButtonList ID="rbGetNameMode" runat="server" RepeatDirection="Horizontal" CssClass="no-border">
                    <asp:ListItem Value="1" Text="HQL" Selected="True" />
                        <asp:ListItem Value="2" Text="SQL" />
                   </asp:RadioButtonList>

                    </td>
                </tr>
                <tr>
                    <td>Id</td>
                    <td>
                        <asp:TextBox ID="txtGetNameId" runat="server" /></td>
                </tr>
                <tr>
                    <th colspan="2">
                        <asp:Button ID="btnGetName" runat="server" Text="Get" OnClick="btnGetName_Click" /></th>
                </tr>
                <tr>
                    <td colspan="2">展现：<asp:Label ID="lblGetNameDisplay" runat="server" /></td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
